package com.fyl.pattern.memento.black_box;



public class Client {
    public static void main(String[] args) {

        System.out.println("--------大战boss前----------------");
      GameRole gameRole = new GameRole();
        gameRole.initState();
        gameRole.stateDisplay();

        //备份
       RoleStateCaretaker roleStateCaretaker = new RoleStateCaretaker();
        roleStateCaretaker.setMemento(gameRole.saveState());

        System.out.println("--------大战boss后----------------");
        gameRole.fight();
        gameRole.stateDisplay();

        System.out.println("--------恢复状态----------------");
        gameRole.recoverState(roleStateCaretaker.getMemento());
        gameRole.stateDisplay();
    }
}
